<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class Col_pro_data {
	function _get_col_pro_array() {
		$col_pro_list[1] = array("1","软件学院","0","0");
		$col_pro_list[2] = array("2","软件工程","1","1");
		$col_pro_list[3] = array("3","软件工程（1+3）","1","1");
		$col_pro_list[4] = array("4","软件工程（2+2）","1","1");
		$col_pro_list[5] = array("5","数字媒体技术","1","1");
		$col_pro_list[6] = array("6","软件工程（国际）","1","1");
		$col_pro_list[7] = array("7","软件工程（赴日加强）","1","1");
		
		$col_pro_list[8] = array("8","艺术学院","0","0");
		$col_pro_list[9] = array("9","音乐表演","8","1");
		$col_pro_list[10] = array("10","艺术设计","8","1");
		
		$col_pro_list[11] = array("11","资源与土木工程学院","0","0");
		$col_pro_list[12] = array("12","采矿工程","11","1");
		$col_pro_list[13] = array("13","安全工程","11","1");
		$col_pro_list[14] = array("14","土木工程","11","1");
		$col_pro_list[15] = array("15","矿物加工工程","11","1");
		$col_pro_list[16] = array("16","环境工程","11","1");
		$col_pro_list[17] = array("17","测绘工程","11","1");
		$col_pro_list[18] = array("18","城市规划","11","1");
		$col_pro_list[19] = array("19","勘查技术与工程","11","1");
		$col_pro_list[20] = array("20","建筑学","11","1");
		$col_pro_list[21] = array("21","资源勘查工程","11","1");
		
		$col_pro_list[22] = array("22","材料与冶金学院","0","0");
		$col_pro_list[23] = array("23","环境科学","22","1");
		$col_pro_list[24] = array("24","冶金工程","22","1");
		$col_pro_list[25] = array("25","材料科学与工程","22","1");
		$col_pro_list[26] = array("26","材料成型及控制工程","22","1");
		$col_pro_list[27] = array("27","热能与动力工程","22","1");
		$col_pro_list[28] = array("28","尖子班","22","1");
		$col_pro_list[29] = array("29","资源循环科学与工程","22","1");
		$col_pro_list[30] = array("30","新能源科学与工程","22","1");
		
		$col_pro_list[31] = array("31","机械工程与自动化学院","0","0");
		$col_pro_list[32] = array("32","机械工程及自动化","31","1");
		$col_pro_list[33] = array("33","过程装备与控制工程","31","1");
		$col_pro_list[34] = array("34","工业设计","31","1");
		$col_pro_list[35] = array("35","尖子班","31","1");
		$col_pro_list[36] = array("36","车辆工程","31","1");
		
		$col_pro_list[37] = array("37","信息科学与工程学院","0","0");
		$col_pro_list[38] = array("38","自动化","37","1");
		$col_pro_list[39] = array("39","测控技术与仪器","37","1");
		$col_pro_list[40] = array("40","通信工程","37","1");
		$col_pro_list[41] = array("41","计算机科学与技术","37","1");
		$col_pro_list[42] = array("42","电子信息工程","37","1");
		$col_pro_list[43] = array("43","计算机尖子班","37","1");
		$col_pro_list[44] = array("44","自动化尖子班","37","1");
		$col_pro_list[45] = array("45","电气工程及其自动化","37","1");
		$col_pro_list[46] = array("46","电子科学与技术","37","1");
		$col_pro_list[47] = array("47","物联网工程","37","1");
		
		$col_pro_list[48] = array("48","工商管理学院","0","0");
		$col_pro_list[49] = array("49","工商管理","48","1");
		$col_pro_list[50] = array("50","会计学","48","1");
		$col_pro_list[51] = array("51","工业工程","48","1");
		$col_pro_list[52] = array("52","市场营销","48","1");
		$col_pro_list[53] = array("53","金融学","48","1");
		$col_pro_list[54] = array("54","国际经济与贸易","48","1");
		$col_pro_list[55] = array("55","信息管理与信息系统","48","1");
		$col_pro_list[56] = array("56","尖子班","48","1");
		
		$col_pro_list[57] = array("57","理学院","0","0");
		$col_pro_list[58] = array("58","信息与计算科学","57","1");
		$col_pro_list[59] = array("59","应用物理学","57","1");
		$col_pro_list[60] = array("60","材料物理","57","1");
		$col_pro_list[61] = array("61","应用化学","57","1");
		$col_pro_list[62] = array("62","工程力学","57","1");
		$col_pro_list[63] = array("63","生物工程","57","1");
		$col_pro_list[64] = array("64","数学及应用数学","57","1");
		
		$col_pro_list[65] = array("65","文法学院","0","0");
		$col_pro_list[66] = array("66","新闻学","65","1");
		$col_pro_list[67] = array("67","思想政治教育","65","1");
		$col_pro_list[68] = array("68","行政管理","65","1");
		$col_pro_list[69] = array("69","法学","65","1");
		$col_pro_list[70] = array("70","公共事业管理","65","1");
		$col_pro_list[71] = array("71","经济学","65","1");
		$col_pro_list[72] = array("72","哲学","65","1");
		
		$col_pro_list[73] = array("73","外国语学院","0","0");
		$col_pro_list[74] = array("74","英语","73","1");
		$col_pro_list[75] = array("75","日语","73","1");
		$col_pro_list[76] = array("76","俄语","73","1");
		$col_pro_list[77] = array("77","德语","73","1");
		
		$col_pro_list[78] = array("78","体育部","0","0");
		$col_pro_list[79] = array("79","社会体育","78","1");
		
		$col_pro_list[80] = array("80","中荷生物医学与信息工程学院","0","0");
		$col_pro_list[81] = array("81","生物医学工程","80","1");
		$col_pro_list[82] = array("82","生物医学工程尖子班","80","1");
		
		$col_pro_list[83] = array("83","国际交流学院","0","0");
		$col_pro_list[84] = array("84","汉语言","83","1");
		return $col_pro_list;
	}
	
	/**
	 * 通过分类id得到分类名
	 * @param $id
	 */
	function _get_category_name_by_id($id) {
		$temp_array = $this->_get_col_pro_array();
		return $temp_array[$id][1];
	}
	
	/**
	 * 通过子分类的id得到父分类名
	 * @param $id
	 */
	function _get_category_parent_name_by_id($id) {
		$temp_array = $this->_get_col_pro_array();
		$parent_id = $temp_array[$id][2];
		return $temp_array[$parent_id][1];
	}
	
	/**
	 * 通过子分类的id得到父分类id
	 * @param $id
	 */
	function _get_category_parent_id_by_id($id) {
		$temp_array = $this->_get_col_pro_array();
		$parent_id = $temp_array[$id][2];
		return $temp_array[$parent_id][0];
	}
	
	/**
	 * 通过父分类id得到子分类信息
	 * @param $p_id
	 */
	function _get_sub_category_by_id($p_id) {
		$temp_array = $this->_get_col_pro_array();
		$sub_array = array();
		foreach($temp_array as $v) {
			if ($v[2] === $p_id) {
				$sub_array[] = $v;
			}
		}
		return $sub_array;
	}
	
	function _get_top_category() {
	
		$temp_array = $this->_get_col_pro_array();
		$top_array = array();
		foreach ($temp_array as $v) {
			if($v[3] === "0"){
			   $top_array[] = $v ;
			}
		}
		return $top_array;
	}
}
?>